<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
        <meta charset="utf-8">
        <meta name="format-detection" content="telephone=no">
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <title>图书详情预览</title>
		<script src="http://libs.baidu.com/jquery/1.10.2/jquery.min.js"></script>
</head>
<style type="text/css">
    body{
        margin:0;
        padding:0;
    }
    .main{
        width:100%;
        text-align: center; 
    }
    .phone{
        width:450px;
        margin:10px auto;
        position:relative; 
    }
    .iframeHtml{
        width:375px;
        height:650px;
        position: absolute;
        top:125px;
        left:37px;
    }
</style>

<body>
    <div class="main">
        <div class="phone">
            <img src="comm/6.png"/>
            <iframe class="iframeHtml" frameborder="no" scrolling="auto" src="/book/bookinfo/tpl">
            </iframe>
        <div>
    </div>
    
</body>
<script type="text/javascript">
$(function(){
    var path=location.href;
    var pathjson=getQueryStringArgs();
    var newpath,lastchar,discount;
    if(pathjson.src!=undefined){
        newpath=pathjson.src;
        if(pathjson.discount!=undefined){
            discount=pathjson.discount;
        }else{
            discount=100;
        }
         $(".iframeHtml").attr("src",newpath+".html?discount="+discount);
         lastchar=path.replace("index",newpath);
    }
    var sUserAgent = navigator.userAgent.toLowerCase();  
    var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";  
    var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";  
    var bIsMidp = sUserAgent.match(/midp/i) == "midp";  
    var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";  
    var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";  
    var bIsAndroid = sUserAgent.match(/android/i) == "android";  
    var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";  
    var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";  
    if (bIsIpad || bIsIphoneOs || bIsMidp || bIsUc7 || bIsUc || bIsAndroid || bIsCE || bIsWM){  
    	preUrl = location.href.substr(0,location.href.lastIndexOf("/")+1);
    	window.location.href=preUrl+$(".iframeHtml").attr("src");
    } 
})
     function getQueryStringArgs() {
        var qs = (location.search.length > 0 ? location.search.substring(1) : ""),
            args = {},
            items = qs.length ? qs.split("&") : [],
            item = null,
            name = null,
            value = null,
            i = 0,
            len = items.length;
        for (i = 0; i < len; i++) {
            item = items[i].split("=");
            
            // decodeURIComponent解码
            name = decodeURIComponent(item[0]);
            value = decodeURIComponent(item[1]);
            
            if (name.length) {
                args[name] = value;
            }
        }
        return args;
     }
    
</script>
</html>
